package mr

// struct used for worker and coordinator.

type TaskStatus int
type TaskType int
type TaskPhase int

const (
	Waiting TaskStatus = 0
	Doing   TaskStatus = 1
	Done    TaskStatus = 2

	MapTask    TaskType = 0
	ReduceTask TaskType = 1
	WaitTask   TaskType = 2
	ExistTask  TaskType = 3

	MapPhase    TaskPhase = 0
	ReducePhase TaskPhase = 1
)

type Task struct {
	Status    TaskStatus
	StartTime int64
	FileId    int
	FileName  string
}

type TaskReqArg struct {
}

type TaskReqReply struct {
	// In MapPhase, Id means the fileId. In ReducePhase, Id means the NReduce
	Id       int
	NMap     int
	NReduce  int
	FileName string
	Type     TaskType
}

type ResponseArg struct {
	// In MapPhase, Id means the fileId. In ReducePhase, Id means the NReduce
	Id       int
	FileName string
	Type     TaskType
}

type ResponseReply struct {
}
